import request from '@/utils/request'
// 获取所有权限
export function getPermissionList() {
  return request({
    url: '/admin/getallright'
  })
}
// 新增权限
export function addPermission(data) {
  return request({
    url: '/admin/addright',
    method: 'post',
    data
  })
}

// 更新权限
export function updatePermission(id, data) {
  return request({
    url: `/admin/editright?id=${id}`,
    method: 'put',
    data
  })
}

// 删除权限
export function delPermission(id) {
  return request({
    url: `/admin/deleteright?id=${id}`,
    method: 'delete'
  })
}
// 获取权限详情
export function getPermissionDetail(id) {
  return request({
    url: `/admin/getright?id=${id}`
  })
}
